//
//  MK_LivingRoomViewModel.m
//  miku直播
//
//  Created by 杨尚达 on 2017/7/29.
//  Copyright © 2017年 杨尚达. All rights reserved.
//

#import "MK_LivingRoomViewModel.h"

@implementation MK_LivingRoomViewModel



-(void)MK_getLivingStreamWithRoomId:(NSString*)roomID andBackBlock:(void(^)(MK_LivingStreamModel* model))backBlock andFaileBlock:(void(^)(NSError* error))failBlock{
    
    
    NSString* urlStr = @"https://m.douyu.com/html5/live";
    [[MK_NetWorking sharedNetWorking] Miku_GET:urlStr parameters:@{@"roomId":roomID} progress:nil success:^(NSURLSessionDataTask * _Nonnull dataTask, id  _Nullable responseObject) {
        if (backBlock) {
            backBlock([MK_LivingStreamModel yy_modelWithJSON:responseObject[@"data"]]);
        }
    } failure:^(NSURLSessionDataTask * _Nullable dataTask, NSError * _Nonnull error) {
        if (failBlock) {
            failBlock(error);
        }
    }];
}

@end
